import { h } from 'vue';
import { NTag } from 'naive-ui';
import { BasicColumn } from '@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '序号',
    key: 'id',
    align: "center",
  }, {
    title: '方案名称',
    key: 'title',
    align: "center",
  }, {
    title: '收费说明',
    key: 'shuoming',
    align: "center",
  }, {
    title: '方案详情',
    key: 'beizhu',
    align: "center",
  }, {
    title: '计费方案',
    key: 'leixing',
    align: "center",
    render(row) {
      if (row.leixing == 0) {
        return h(
          NTag,
          {
            type: 'error',
          },
          {
            default: () => ('按1分钟收费'),
          },
        );
      } else if (row.leixing == 1) {
        return h(
          NTag,
          {
            type: 'success',
          },
          {
            default: () => ('按30分钟收费'),
          },
        );
      }
    }
  }, {
    title: '创建时间',
    key: 'create_time',
    align: "center",
  }, {
    title: '创建人',
    key: 'username',
    align: "center",
  }
];
